package JavaSEAdvance;

/**
 * @author Xiao
 * @date 2021/7/20
 */
public class TimeCountTest {
    public static void main(String[] args) {
        int count = 0;
        int countHour = 0;
        int countMinute = 0;
        int countSecond = 0;
        long start = System.currentTimeMillis();
        while (countHour < 24) {
            long end = System.currentTimeMillis();
            if (end - start > 1000 * count) {
                count++;
                System.out.println(countHour + ":" + countMinute + ":" + countSecond++);
                if (countSecond > 59) {
                    countMinute++;
                    countSecond = 0;
                    if (countMinute > 59) {
                        countHour++;
                        countMinute = 0;
                        if (countHour > 23) {
                            countSecond = 0;
                            countMinute = 0;
                            countHour = 0;
                        }
                    }
                }
            }
        }
    }
}
